package com.chinasoft.mall.activity;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.chinasoft.mall.R;
import com.chinasoft.mall.framework.Config;
import com.chinasoft.mall.model.BaseBean;
/**
 * 首页_推荐频道
 * @author Administrator
 *
 */
public class SyPdMoreActivity extends BaseActivity implements OnClickListener {
//	模特频道
	private Button model_btn;
//	团购频道
	private Button tg_btn;
//	模特频道列表
	private BaseBean model_bb;
//	团购列表
	private BaseBean tg_bb;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.sy_more);
		initView();
	}

	private void initView() {
		model_btn=(Button) findViewById(R.id.model_btn);
		tg_btn=(Button) findViewById(R.id.tg_btn);
		model_btn.setOnClickListener(this);
		tg_btn.setOnClickListener(this);
	}

	@Override
	public void success(BaseBean obj) {
		super.success(obj);
		if(obj.equals(model_bb)){
			((MainActivity)getParent()).setCurrentActivity(SyModelListActivity.class,"模特频道");
		}else if(obj.equals(tg_bb)){
			((MainActivity)getParent()).setCurrentActivity(SyGroupBuyListActivity.class,"人气商品团购");
		}
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.model_btn:
			model_bb=new BaseBean(Config.GET_MODELLIST);
			control.sendMessage(model_bb);
			break;
		case R.id.tg_btn:
			tg_bb=new BaseBean(Config.GET_GOODSGRP);
			control.sendMessage(tg_bb);
			break;
		default:
			break;
		}
	}
}
